package com.zhongge.entity;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @ClassName StuConfig
 * @Description TODO
 * @Author zhongge
 * @Version 1.0
 */
@Configuration
public class StuConfig {
    @Bean("stu")//使用名字的话 那么此时对象的名字就是你指定的名字
    public Student student() {
        Address address = new Address();
        address.setLoc("毕节");
        Student student = new Student();
        student.setId(1001);
        student.setAge(18);
        student.setAddress(address);
        student.setName("刘备");
        return student;
    }
}
